{if isset($menu)}
<ul class="expandingMenu">
{foreach from=$menu item=page}
    <li>
        <a href="/{$baseDir}/{$language}/{$page.controller}/{$page.action}/{$page.id}" title="{$page.linktitle}"{if $page.selected || $page.childSelected} class="selected"{/if}>{$page.linktitle}</a>
    {if isset($page.subpages)}
        <ul>
            {foreach from=$page.subpages item=subpage}
                <li><a href="/{$baseDir}/{$language}/{$subpage.controller}/{$subpage.action}/{$subpage.id}" title="{$subpage.linktitle}"{if $subpage.selected} class="selected"{/if}>{$subpage.linktitle}</a></li>
            {/foreach}
        </ul>
    {/if}
    </li>
{/foreach}
</ul>
{/if}